<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/taglibs.jsp" %>
<html>
<head>
    <title>目录修改页面</title>
    <link rel="stylesheet" href="assets/admin/css/pintuer.css">
    <link rel="stylesheet" href="assets/admin/css/admin.css">
    <script type="text/javascript" src="assets/js/myjs/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="assets/admin/js/pintuer.js"></script>
    <%--<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.5.7/layui.js"></script>--%>


    <%--先引入config--%>

    <script type="text/javascript" charset="utf-8" src="assets/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript " charset="utf-8" src="assets/js/ueditor/ueditor.all.js"></script>
</head>
<body>


<div class="panel admin-panel "<%-- style="margin-left: auto; margin-right: auto ;width: 40%;margin-top: 0px"--%>>
    <div class="panel-head" id="add">
        <strong><span class="icon-plus-square-o">新增商品</span> </strong>
    </div>
    <div class="body-content">
        <form action="/good/add" class="form-x " method="post" enctype="multipart/form-data" >
            <input type="hidden" name="activeFlag" value="1">
            <div class="form-group"></div>
            <div class="label"><label>选择目录：</label></div>
            <div class="field">
                <select name="dirId" class="input w100">
                    <c:forEach items="${goodType}" var="obj" varStatus="l">
                        <option value="${obj.rowId}">${obj.dirName}</option>
                    </c:forEach>
                </select>
                <div class="tipss"></div>
            </div>

            <div class="form-group"></div>
            <div class="label"><label>商品编号：</label></div>
            <div class="field">
                <input type="text" class="input w100" name="goodId"
                       obj-validate="required: 请输入商品编号"
                       value="${obj.goodId}">
                <div class="tipss"></div>
            </div>

            <div class="form-group"></div>
            <div class="label"><label>上传主图：</label></div>
            <div class="field">
                <input type="file" class="input w100" name="file"obj-validate="required: 请上传图片" >
                <div class="tipss"></div>
            </div>

            <div class="form-group"></div>
            <div class="label"><label>商品价格：</label></div>
            <div class="field">
                <input type="text" class="input w100" name="goodPrice"
                       obj-validate="required: 请输入商品价格"
                       value="${obj.goodPrice}">
                <div class="tipss"></div>
            </div>

            <div class="form-group"></div>
            <div class="label"><label>商品库存：</label></div>
            <div class="field">
                <input type="text" class="input w100" name="goodInventoryNumber"
                       obj-validate="required: 请输入库存数"
                       value="${obj.goodInventoryNumber}">
                <div class="tipss"></div>
            </div>

            <div class="form-group"></div>
            <div class="label"><label>是否上架：</label></div>
            <div class="field">
                <input type="text" class="input w100" name="goodUpdownState"
                       obj-validate="required: 请添加是否上架"
                       value="${obj.goodUpdownState}">
                <div class="tipss"></div>
            </div>


            <div class="form-group"></div>
            <div class="label"><label>商品描述：</label></div>
            <div class="field">
                <script type="text/plain" id="remark_txt_1" name="goodInfo"
                        style="width: 100%;height: 300px;">${obj.goodInfo}</script>
                <div class="tipss"></div>
            </div>


            <div class="form-group">
                <div class="label"></div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit">提交</button>
                </div>
            </div>

        </form>
    </div>
</div>

</body>

<script>
    $(document).ready(function () {
        function changeSearch() {
            $('#editform').submit();
        }

        layui.use(['layer', 'form'], function () {
            var layer = layui.layer, form = layui.form;
        });
    });


    
    var editor = UE.getEditor('remark_txt_1');
    UE.Editor.prototype._bKGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function (action) {
        if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadvideo') {
            return '/ueditor/saveFile';
        } else {
            return this._bKGetActionUrl.call(this, action);
        }
    }
</script>


</html>
